package com.awakening.sorting.test;

import com.awakening.sorting.util.SortTestHelper;

import java.util.Arrays;

/**
 * @Author:AwakeningCode
 * @Date: Created in 11:15 2018\1\17 0017
 */
public class SelectWithInsertSort {

    //比较SelectionSort和InsertionSort两种排序算法的性能效率
    //此时，插入排序比选择排序性能略低
    public static void main(String[] args) {
        int N = 20000;
        System.out.println("Test for random array, size = " + N + " , random range [0, " + N + "]");

        Integer[] arr1 = SortTestHelper.generateRandomArray(N,0,N);
        Integer[] arr2 = Arrays.copyOf(arr1,arr1.length);

        SortTestHelper.testSort("com.awakening.sorting.basic.SelectionSortTest",arr1);
        SortTestHelper.testSort("com.awakening.sorting.basic.InsertionSort",arr2);

        return;
    }

}
